import Vue from 'vue'
import Router from 'vue-router'    // export default {功能}  抛出  才能引入

// 通过路径找到对应的vue组件来展示
// @  -- src目录
import ShowCenter from '@/components/ShowCenter'
import Base from '@/components/Base'
import Login from '@/components/Login'
import Host from '@/components/Host'
import Console from '@/components/Console'

Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      // name: 'ShowCenter',
      component: Login
    },
    {
      path: '/hippo',
      // name: 'ShowCenter',
      component: Base,
      children:[
        {
          path: 'host/',   // /hippo/host/
          // name: 'ShowCenter',
          component: Host
        },
        {
          path: 'showcenter/',   // /hippo/host/

          component: ShowCenter
        },
        {
          // router   route     router路由跳转动作，this.$router.push('/')
          // this.route.params.id  -- 2
          path: 'console/:id/',   // /hippo/host/  动态路由匹配 /hippo/console/2/  router

          component: Console
        },
      ]
    },
    {
      path: '/host',
      // name: 'ShowCenter',
      component: Host
    }
  ]
})




